package com.ssm.lzh.service.impl;

import com.ssm.lzh.service.OrderSettingService;
import com.ssm.mapper.OrderSettingMapper;
import com.ssm.pojo.T_ordersetting;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Service
public class OrderSettingServiceImpl implements OrderSettingService {


    @Resource
    private OrderSettingMapper orderSettingMapper;

    @Override
    public List<T_ordersetting> queryOrderSetting() {

        return this.orderSettingMapper.queryOrderSetting();
    }

    @Override
    public int updateOrderSetting(T_ordersetting t_ordersetting) {
        if(t_ordersetting.getId()>0){
          return   this.orderSettingMapper.updateOrderSetting(t_ordersetting);
        }
        return this.orderSettingMapper.insertOrderSetting(t_ordersetting);
    }

    @Override
    public int queryBookingdate(String date) {


        T_ordersetting i=this.orderSettingMapper.queryBookingdate(date);
        if(i==null){
            return 1;
        }

        return 0;
    }
}
